/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.own.service;

import java.util.List;

import com.jeesite.modules.sys.utils.UserUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.own.entity.OwnCompanyBasicInformation;
import com.jeesite.modules.own.dao.OwnCompanyBasicInformationDao;

/**
 * 企业基本信息Service
 * @author F
 * @version 2019-09-29
 */
@Service
@Transactional(readOnly=true)
public class OwnCompanyBasicInformationService extends CrudService<OwnCompanyBasicInformationDao, OwnCompanyBasicInformation> {


	@Autowired
	private OwnCompanyBasicInformationDao ownCompanyBasicInformationDao;
	/**
	 * 获取单条数据
	 * @param ownCompanyBasicInformation
	 * @return
	 */
	@Override
	public OwnCompanyBasicInformation get(OwnCompanyBasicInformation ownCompanyBasicInformation) {
		return super.get(ownCompanyBasicInformation);
	}

	public OwnCompanyBasicInformation getCompanyBasicInformation(){
		return ownCompanyBasicInformationDao.getOwnCompanyBasicInformation();
	}
	
	/**
	 * 查询分页数据
	 * @param ownCompanyBasicInformation 查询条件
	 * @param ownCompanyBasicInformation.page 分页对象
	 * @return
	 */
	@Override
	public Page<OwnCompanyBasicInformation> findPage(OwnCompanyBasicInformation ownCompanyBasicInformation) {
		return super.findPage(ownCompanyBasicInformation);
	}
	
	/**
	 * 保存数据（插入或更新）
	 * @param ownCompanyBasicInformation
	 */
	@Override
	@Transactional(readOnly=false)
	public void save(OwnCompanyBasicInformation ownCompanyBasicInformation) {
		ownCompanyBasicInformation.setCreateCompany(UserUtils.getUser().getExtend().getExtendS1());
		super.save(ownCompanyBasicInformation);
	}
	
	/**
	 * 更新状态
	 * @param ownCompanyBasicInformation
	 */
	@Override
	@Transactional(readOnly=false)
	public void updateStatus(OwnCompanyBasicInformation ownCompanyBasicInformation) {
		super.updateStatus(ownCompanyBasicInformation);
	}
	
	/**
	 * 删除数据
	 * @param ownCompanyBasicInformation
	 */
	@Override
	@Transactional(readOnly=false)
	public void delete(OwnCompanyBasicInformation ownCompanyBasicInformation) {
		super.delete(ownCompanyBasicInformation);
	}
	
}